package com.demo0301.servlet;

import javax.servlet.*;
import java.io.IOException;
import java.util.HashSet;

public class Demo01Servlet implements Servlet {
    public Demo01Servlet() {
        System.out.println("Demo01Servlet 的无参构造函数");
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        System.out.println("Demo01Servlet init()");
        System.out.println(servletConfig.getServletName());
        System.out.println(servletConfig.getInitParameter("username"));
        System.out.println(servletConfig.getInitParameter("password"));

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("Demo01Servlet service()");
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {
        System.out.println("Demo01Servlet destroy()");
    }
}
